import HttpService from "@/api";
import type { CodeResponse, LoginForm, LoginResponse, Menu } from "@/typings";

/**
 * @description 登录
 * @param params 登录数据
 */
export const login = (userForm: LoginForm) => HttpService.post<LoginResponse>("/auth/login", userForm);

/**
 * @description 退出登录
 */
export const logOutApi = () => HttpService.post<LoginResponse>("/auth/logout");

/**
 * @description 获取验证码
 * @returns
 */
export const getCode = () => HttpService.get<CodeResponse>("/user/code");

/**
 * @description 获取用户菜单
 */
export const getMenuList = () => HttpService.get<Menu[]>("/auth/getMenus");

/**
 * @description 获取用户信息
 */
export const getInfoApi = () => HttpService.get("/auth/getInfo");
